package com.nexgo.payment.trans.setting.othersfunc;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.nexgo.payment.R;
import com.nexgo.payment.ui.ListMenuActivity;
import com.nexgo.payment.util.UIUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 应用参数设置：其他功能设置
 *
 * @author 谭忠扬-YuriTam
 * @time 2017年7月7日
 */
public class OtherParamActivity extends ListMenuActivity {
    private static final String TAG = OtherParamActivity.class.getSimpleName();

    private List<Integer> mItemList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    @Override
    protected String getActivityTitle() {
        return getString(R.string.other_function_settings);
    }

    @Override
    protected void onItemClick(int position) {
        if (UIUtils.isDoubleClick()) {
            return;
        }
        int item = mItemList.get(position);
        switch (item) {
            case R.string.clear_menu:
                intent2Activity(SetupClearTransRecordActivity.class);
                break;
            case R.string.order_print:
                intent2Activity(SetupPrintParamActivity.class);
                break;
            case R.string.download_menu:
                intent2Activity(SetupDownloadMenuActivity.class);
                break;
            default:
                break;
        }
    }

    private void initView() {
        mItemList = new ArrayList<>();
        mItemList.add(R.string.clear_menu);
        mItemList.add(R.string.order_print);
        mItemList.add(R.string.download_menu);
        for (Integer i : mItemList) {
            addItem(i);
        }
    }

    public static Intent newInstance(Context context) {
        return new Intent(context, OtherParamActivity.class);
    }
}
